#!/usr/bin/env python
# -*- coding: utf-8 -*-

# third part
from PyQt5.QtWidgets import (
    QVBoxLayout,
    QWidget,
)

from MdiChild1 import Window as Window1
from MdiChild2 import Window as Window2

class MdiChild1(QWidget):
    sequenceNumber = 1

    def __init__(self):
        super(MdiChild1, self).__init__()

        self.window = Window1.Window()
        self.vbox = QVBoxLayout()
        self.vbox.addWidget(self.window)
        self.setLayout(self.vbox)
        self.setWindowTitle("MdiChild1:%d" % MdiChild1.sequenceNumber)
        MdiChild1.sequenceNumber += 1

class MdiChild2(QWidget):
    sequenceNumber = 1

    def __init__(self, title=None):
        super(MdiChild2, self).__init__()

        self.window = Window2.Window(title)
        self.vbox = QVBoxLayout()
        self.vbox.addWidget(self.window)
        # self.vbox.addStretch(1)
        self.setLayout(self.vbox)
        self.setWindowTitle("MdiChild2:%d:%s" % (MdiChild2.sequenceNumber, title))
        MdiChild2.sequenceNumber += 1

if __name__ == '__main__':
    import sys
    from PyQt5.QtWidgets import QApplication

    app = QApplication(sys.argv)
    # mainWin = MdiChild1()
    mainWin = MdiChild2()
    mainWin.show()
    sys.exit(app.exec_())
